{% extends 'movie/base.html' %}
{% block content %}

    <link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
    <link href="{% static 'css/star-rating.css' %}" media="all" rel="stylesheet" type="text/css"/>
    <script src="{% static 'js/star-rating.js' %}" type="text/javascript"></script>
    <style>
    iframe{
    position: fixed;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    z-index: -1;
    }
        .poster {
            float: left;
            margin: 3px 12px 0 0;
            overflow: hidden;
            text-align: center;
        }

        .info {
            max-width: 800px;
            margin-top: 15px;
            float: left;
            word-wrap: break-word;
        }
        .smovie{
            display: block;
            float: left;
            font-size: 15px;
            text-align: center;
            margin:0 25px 10px 0;
            width: 200px;
        }
        hr {
            -moz-border-bottom-colors: none;
            -moz-border-image: none;
            -moz-border-left-colors: none;
            -moz-border-right-colors: none;
            -moz-border-top-colors: none;
            border-color: #ffffff;
            border-style: solid none;
            border-width: 1px 0;
            margin: 18px 0;
        }
        
        
                .custom-container {
            background-color: transparent;
            {#padding: 20px;#}
            {#border: 1px solid #ccc;#}
        }
        
        .custom-alert {
            background-color: #d9edf7;
            border-color: #bce8f1;
            color: #31708f;
            margin-bottom: 10px;
        }
        
        .custom-form-container {
            background-color: #fff;
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }
        
        .custom-form-container .form-control {
            font-size: 16px;
        }
        
        .custom-form-container .btn-custom {
            background-color: #000dfd;
            color: #fff;
            border-color: rgb(0, 13, 253);
        }
        
        .custom-form-container .btn-custom:hover {
            background-color: #bc2626;
            border-color: #bc2626;
            color: #fff;
        }

        
        
        label[for="input-2ba"] {
            font-size: 16px; /* 设置合适的字体大小 */
        }
        
        label[for="comment"] {
             font-size: 16px; /* 设置合适的字体大小 */
        }
        
        
    </style>
    <!--展示电影信息-->
    <div class="container">
        <div class="poster">
            <a href="{% url 'movie:detail' movie.pk %}" class="item">
                <div class="poster_div">
                    <img src="/static/movie/img/{{ movie.imdb_id }}.jpg" alt="">
                </div>
            </a>
        </div>

    
            <div class="info">
                <p style="font-size: 20px; color: #ffffff;">
                    电影名：{{ movie.name }}
                    <span>
                        {% for foo in movie.get_score_int_range %}
                            ★
                        {% endfor %}
                    </span>
                    <strong>{{ movie.get_score }}</strong>
                </p>
{#                <p style="font-size: 20px; color: #ffffff;">简介：{{ movie.intro }}</p>#}
                <p style="font-size: 20px; color: #ffffff;">导演：{{ movie.director }}</p>
                <p style="font-size: 20px; color: #ffffff;">国家：{{ movie.writers }}</p>
                <p style="font-size: 20px; color: #ffffff;">主演：{{ movie.actors }}</p>
                <p style="font-size: 20px; color: #ffffff;">
                    类型：
                    {% for genre in movie.get_genre %}
                        <a href="{% url 'movie:tag' %}?genre={{ genre }}" style="color: #ffffff;">{{ genre }}</a>
                        {% if not forloop.last %}
                            <span style="color: #ffffff;">|</span>
                        {% endif %}
                    {% endfor %}
                </p>
                {# <p style="font-size: 20px; color: #ffffff;">时长：{{ movie.time }}</p> #}
                <p style="font-size: 20px; color: #ffffff;">发行时间：{{ movie.release_time }}</p>
            </div>
    
    
    </div>
    <div class="container similarity_movie">
        <br>
        <div class="alert alert-warning" role="alert" style="font-size: 20px; color: #000000;">喜欢上面电影的人也喜欢</div>

        {% for movie in similarity_movies %}
            <div class="smovie" {% if forloop.first %} style="margin-left: -6px" {% endif %}>
                <a href="{% url 'movie:detail' movie.pk %}" class="item">
                    <div class="poster_div">
                        <img src="/static/movie/img/{{ movie.imdb_id }}.jpg" alt="">
                        <p style="color: #ffffff;">{{ movie.name }}<br>
                            <strong style="color:#ffffff">评分{{ movie.get_score }}</strong>
                        </p>
                    </div>
                </a>
            </div>

        {% endfor %}
    </div>
    
{#    <div class="container">#}
{#        <br>#}
{#        {% for message in messages %}#}
{#            {% if message.tags == 'info' %}#}
{#                <div class="alert alert-info" role="alert">{{ message }}</div>#}
{#            {% endif %}#}
{#        {% endfor %}#}
{#    </div>#}
{#    {% if login %}#}
{##}
{#        <div class="container">#}
{##}
{#            <hr>#}
{##}
{#            <form class="star" action="" method="post">#}
{##}
{#                <input id="input-2ba" name="score" value="{{ score }}" type="number" class="rating" min="0" max="5"#}
{#                       step="0.5"#}
{#                       data-stars=5#}
{#                       data-symbol="&#xe005;" data-default-caption="{rating} hearts" data-star-captions="{}">#}
{#                <label for="comment">评论:</label>#}
{#                <textarea class="form-control" name="comment" rows="5" id="comment">{{ comment }}</textarea>#}
{#                <br>#}
{#                <div class="form-group">#}
{##}
{#                    <button type="submit" class="btn btn-primary" style="margin-right: 10px">提交</button>#}
{#                    <button type="reset" class="btn btn-default">清空</button>#}
{#                </div>#}
{#            </form>#}
{#            <br>#}
{#            <script>#}
{#                jQuery(document).ready(function () {#}
{#                    $(".rating-kv").rating();#}
{#                });#}
{#            </script>#}
{#        </div>#}
{##}
{#    {% endif %}#}
    
<div class="container custom-container" >
    <hr>
    
    {% for message in messages %}
        {% if message.tags == 'info' %}
            <div class="alert alert-info custom-alert" role="alert">{{ message }}</div>
        {% endif %}
    {% endfor %}

    {% if login %}
        <div class="custom-form-container">
            <form class="star" action="" method="post">
                <div class="form-group">
                    <label for="input-2ba">评分:</label>
                    <input id="input-2ba" name="score" value="{{ score }}" type="number" class="form-control rating"
                           min="0" max="5" step="0.5"
                           data-stars="5"
                           data-symbol="&#9733;" data-default-caption="{rating} stars" data-star-captions="{}">
                </div>
                <div class="form-group">
                    <label for="comment">评论:</label>
                    <textarea class="form-control" name="comment" rows="5" id="comment">{{ comment }}</textarea>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-custom">提交</button>
{#                    <button type="reset" class="btn btn-default">清空</button>#}
                </div>
            </form>
            <br>
            <script>
                jQuery(document).ready(function () {
                    $(".rating").rating();
                });
            </script>
        </div>
    {% endif %}
</div>
    
    
    
{% endblock %}